# Python asyncio 示例
import aiohttp
import asyncio

async def fetch(url):
    async with aiohttp.ClientSession() as session:
        async with session.get(url) as response:
            return await response.text()

async def main():
    urls = ["https://baidu.com", "https://bilibili.com"]
    tasks = [fetch(url) for url in urls]
    results = await asyncio.gather(*tasks)  # 单线程内并发请求
    print(results)

asyncio.run(main())